package com.zhuwentao.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhuwentao.dao.LiuShuiDao;
import com.zhuwentao.entity.LiuShui;
import com.zhuwentao.service.LiuShuiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LiuShuiServiceImpl implements LiuShuiService {
   @Autowired
   LiuShuiDao liuShuiDao;

   @Override
   public PageInfo<LiuShui> list(LiuShui liuShui, Integer pageNum, Integer pageSize) {
      PageHelper.startPage(pageNum,pageSize);
      List<LiuShui> list = liuShuiDao.list(liuShui);
      PageInfo<LiuShui> info = new PageInfo<>(list);
      return info;
   }

   @Override
   public int add(LiuShui liuShui) {
      return liuShuiDao.add(liuShui);
   }

   @Override
   public List<LiuShui> selectYuanname(String yuanname) {
      return liuShuiDao.selectYuanname(yuanname);
   }
}
